﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
//using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MW3Launcher
{
    public partial class TabControlEx : TabControl
    {
        public TabControlEx() : base()
        {
            InitializeComponent();
        }
        /// <summary>
        /// Gets or sets a value indicating whether the tab headers should be drawn
        /// </summary>
        [
        Description("Gets or sets a value indicating whether the tab headers should be drawn"),
        DefaultValue(true)
        ]
        private bool _showheader;
        public bool ShowTabHeaders
        {
            get { return _showheader; }
            set { _showheader = value; }
        }


        protected override void WndProc(ref Message m)
        {
            //Hide tabs by trapping the TCM_ADJUSTRECT message
            if (!_showheader && m.Msg == 0x1328 && !DesignMode)
                m.Result = (IntPtr)1;
            else
                base.WndProc(ref m);
        }
    }
}
